import React, { useState } from 'react'
import config from '../common/Common'
import '@/style/sider/fileFloder.scss'
const baseMargin = 20;

export default function FileFloder({ margin }) {
    const [spread, setSpread] = useState(false); // 是否展开
    const { IconFont } = config
    const handleSpread = (spread) => {
        setSpread(spread);
    }
    return (
        <div className='fileFolder' style={{
            marginLeft: margin ? margin + baseMargin : baseMargin
        }}>
            <div className='fileFolder-icon-name'>
                <IconFont type='iconwenjianjia' className='fileFolder-icon' />
                <p className='fileFolder-name'>xxx</p>
            </div>
            <IconFont
                type={spread ? 'iconshangla' : 'iconxiala'}
                className='fileFolder-icon'
                onClick={() => { handleSpread(!spread) }}
            />
        </div>
    )
}
